<?php

/**
 * Factura form base class.
 *
 * @method Factura getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseFacturaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'fac_id'            => new sfWidgetFormInputHidden(),
      'fac_numfactura'    => new sfWidgetFormInputText(),
      'fac_rif'           => new sfWidgetFormInputText(),
      'fac_dirfiscal'     => new sfWidgetFormInputText(),
      'fac_cantpaquete'   => new sfWidgetFormInputText(),
      'fac_envioxpaquete' => new sfWidgetFormInputText(),
      'fac_montototal'    => new sfWidgetFormInputText(),
      'fac_telefonos'     => new sfWidgetFormInputText(),
      'fac_solicitud'     => new sfWidgetFormPropelChoice(array('model' => 'Solicitud', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'fac_id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->getFacId()), 'empty_value' => $this->getObject()->getFacId(), 'required' => false)),
      'fac_numfactura'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'fac_rif'           => new sfValidatorString(array('max_length' => 50)),
      'fac_dirfiscal'     => new sfValidatorString(array('max_length' => 200)),
      'fac_cantpaquete'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'fac_envioxpaquete' => new sfValidatorNumber(),
      'fac_montototal'    => new sfValidatorNumber(),
      'fac_telefonos'     => new sfValidatorString(array('max_length' => 200)),
      'fac_solicitud'     => new sfValidatorPropelChoice(array('model' => 'Solicitud', 'column' => 'sol_id')),
    ));

    $this->widgetSchema->setNameFormat('factura[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Factura';
  }


}
